using System;
using System.Collections;
using System.ComponentModel;
using System.Runtime.Serialization;


namespace Entities
{
    [Serializable]
    [System.Data.Services.Common.DataServiceKey("ID")]
    public class User:EntityBase
    {
        #region User Properties
        private System.String _UserCode;
		[DataMember] public virtual System.String UserCode
		{
			get
			{
				return _UserCode;
			}
			set
			{
                if (_UserCode != value)
                {
                    _UserCode = value;
                    OnPropertyChanged("UserCode");
                }
			}
		}
        private System.String _Password;
		[DataMember] public virtual System.String Password
		{
			get
			{
				return _Password;
			}
			set
			{
                if (_Password != value)
                {
                    _Password = value;
                    OnPropertyChanged("Password");
                }
			}
		}
        private System.String _Name;
		[DataMember] public virtual System.String Name
		{
			get
			{
				return _Name;
			}
			set
			{
                if (_Name != value)
                {
                    _Name = value;
                    OnPropertyChanged("Name");
                }
			}
		}
        private System.String _Email;
		[DataMember] public virtual System.String Email
		{
			get
			{
				return _Email;
			}
			set
			{
                if (_Email != value)
                {
                    _Email = value;
                    OnPropertyChanged("Email");
                }
			}
		}
        private System.Int32? _RoleID;
		[DataMember] public virtual System.Int32? RoleID
		{
			get
			{
				return _RoleID;
			}
			set
			{
                if (_RoleID != value)
                {
                    _RoleID = value;
                    OnPropertyChanged("RoleID");
                }
			}
		}
        private System.DateTime? _CreateDate;
		[DataMember] public virtual System.DateTime? CreateDate
		{
			get
			{
				return _CreateDate;
			}
			set
			{
                if (_CreateDate != value)
                {
                    _CreateDate = value;
                    OnPropertyChanged("CreateDate");
                }
			}
		}
        #endregion
        public override bool Equals(object obj)
        {
            if (obj == this) return true;
            if (obj == null) return false;
            if (obj is User)
            {
                return (this.ID == (obj as User).ID);
            }
            return false;
        }
        public override int GetHashCode()
        {
            return ID.GetHashCode();
        }
    }
}